package com.hsgene.order.constants;

/**
 * 付款人类型
 *
 * @author wangbing
 * @version 1.0
 * @date 2019/1/29 10:43
 * Copyright: Copyright (c) 2019
 */
public enum PayerType {

    DIFU(1, "地服代付"),

    PATIENT(0, "患者支付");

    private final int code;

    private final String desc;

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    PayerType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static PayerType getEnum(int code) {
        if (0 == code) {
            return PATIENT;
        } else if (1 == code) {
            return DIFU;
        } else {
            throw new IllegalArgumentException("非法的支付人类型code值：" + code);
        }
    }
}
